<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    div{
      background: pink;
      width: 200px;
      height: 200px;
    }
    .change{
      background: gray;
      width: 400px;
      height: 400px;
      margin-top:200px ;
    }
  </style>
</head>
<body>
<div>文本</div>
<script>
  var div=document.querySelector('div');
  div.onclick=function () {
    div.className='change'
  }
</script>
</body>
</html>
